package cn.sh.library.gmwx.sparql;

import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import cn.sh.library.gmwx.bean.InstanceSearchBean;
import cn.sh.library.gmwx.dto.Pager;
import cn.sh.library.gmwx.dto.QueryResult;

public interface InstanceSparql {
    /**
     * Get work's instances.
     * @param work_uri
     * @return
     */
    public List<Map<String, String>> getWorkInstances(String work_uri);

    /**
     * Query instances
     * @param search
     * @param order
     * @param pager
     * @return
     */
    public QueryResult<Map<String, String>> getWorkInstances(InstanceSearchBean search, String order, Pager pager);

    public void countInstance();
    public void updateFacetInstance(String facet, String type);

    public Map<String, String> getBibInfos(String instance_uri);
    public List<Map<String, Object>> getContributions(String instance_uri);
    public List<Map<String, String>> getWorks(String instance_uri);

    /**
     * Get instance temp model including work,instance,item details
     * @param instance_uri
     * @return
     */
    public OutputStream instanceTempModel(String instance_uri);

    public List<Map<String, String>> countInstanceFacet(InstanceSearchBean search, String facet);
    
    public List<Map<String, String>> getPlacesInArea(String points, InstanceSearchBean search);

	List<Map<String, String>> getPlacesInAreaCount(String points, InstanceSearchBean search);
}
